﻿<controlli:BaseCusControl x:Class="DocManagerControls.Controls.RicercaDocControl"
             xmlns:controlli="clr-namespace:DocManagerControls.Controls"
             xmlns:convert="clr-namespace:DocManagerControls.Converters"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" Background="YellowGreen" JournalEntry.Name="Ricerche documenti"
              AllowDrop="True" HorizontalContentAlignment="Left"
             HorizontalAlignment="Left" VerticalAlignment="Top" Width="Auto">

    <StackPanel Orientation="Horizontal">
    <Grid Name="grid1" AllowDrop="True" Height="Auto" HorizontalAlignment="Left"  >
        
       <Rectangle Height="62" Margin="5" Name="rectangle1" Stroke="#FF59EFCC" VerticalAlignment="Top" Width="435" Fill="#FF61AEDE" />

        <TextBox x:Name="txtNomeDoc" Height="32"  HorizontalAlignment="Left" Margin="12,34,0,0" VerticalAlignment="Top" 
                 Width="420" IsReadOnly="False" AcceptsReturn="True" PreviewKeyDown="txtNomeDoc_PreviewKeyDown" AcceptsTab="False" TabIndex="2" />
        <Label Height="25" HorizontalAlignment="Left" Margin="10,394,0,0" Name="lblMessaggi" VerticalAlignment="Top" Width="429" />
        <ComboBox Height="20" HorizontalAlignment="Left" Margin="12,106,0,0" Name="comboCategorie" VerticalAlignment="Top" Width="430" SelectionChanged="comboCategorie_SelectionChanged" TabIndex="4" />
        <Label FontWeight="Normal" Foreground="#FF041332" Height="26" HorizontalAlignment="Left" IsEnabled="False" Margin="13,80,0,0" Name="label3" VerticalAlignment="Top" Width="62" Content="Categoria" />
        <!---->
           <Button Content="Cerca" Height="26" HorizontalAlignment="Left" Margin="22,362,0,0" Name="btnCerca" VerticalAlignment="Top" Width="103" Click="btnCerca_Click" BorderBrush="#FF074B3C">
            <Button.Background>
                <RadialGradientBrush>
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FFDDD40C" Offset="0.617" />
                    <GradientStop Color="#FF18AD74" Offset="0.074" />
                </RadialGradientBrush>
            </Button.Background>
        </Button>
        
        <Button BorderBrush="#FF074B3C" Content="Vedi doc." Height="26" HorizontalAlignment="Left" Margin="145,362,0,0" Name="btnVediDoc" 
                VerticalAlignment="Top" Width="103" Click="btnVediDoc_Click">
            <Button.Background>
                <RadialGradientBrush>
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#FFDDD40C" Offset="0.617" />
                    <GradientStop Color="#FF18AD74" Offset="0.074" />
                </RadialGradientBrush>
            </Button.Background>
        </Button>
        
        <ComboBox Height="20" HorizontalAlignment="Left" Margin="13,158,0,0" Name="comboSottoCategorie" VerticalAlignment="Top" Width="430"  TabIndex="5"/><Label Content="SottoCategoria" FontWeight="Normal" Foreground="#FF041332" Height="26" HorizontalAlignment="Left" IsEnabled="False" Margin="14,132,0,0" Name="label6" VerticalAlignment="Top" Width="88" />
        <Label Content="Nome del file \ documento" FontWeight="Normal" Foreground="#FF041332" Height="26" HorizontalAlignment="Left" IsEnabled="False" Margin="10,10,0,0" Name="label4" VerticalAlignment="Top" Width="303" />
        <Expander Header="Altre ricerche" Height="140" HorizontalAlignment="Left" Margin="14,199,0,0" Name="expander1" VerticalAlignment="Top" Width="428">
            <StackPanel>
                <Label Content="Tags predefiniti" FontWeight="Normal" Foreground="#FF041332" Height="29" HorizontalAlignment="Left" IsEnabled="False" Margin="0" Name="label1" VerticalAlignment="Top" Width="89" />
                <ComboBox Height="20" HorizontalAlignment="Left" Margin="0" Name="comboTagsPredefiniti" VerticalAlignment="Top" Width="410" />
                <Label Content="Tags personalizzati" Margin="0" FontWeight="Normal" Foreground="#FF041332" Height="29" HorizontalAlignment="Left" IsEnabled="False"  Name="label2" VerticalAlignment="Top" Width="105" />
                <TextBox Height="20" HorizontalAlignment="Left" Margin="0" Name="txtTagsPersonalizzati" VerticalAlignment="Top" Width="410" />

            </StackPanel>
        </Expander><CheckBox Content="Cerca per ID" Height="19" HorizontalAlignment="Left" Margin="165,72,0,0" Name="checkBoxIsID" VerticalAlignment="Top" Width="83"  TabIndex="3"/>
     </Grid>
        <Grid>
            
        <ListView x:Name="listDocs" MinHeight="400" HorizontalAlignment="Left" Margin="1"  VerticalAlignment="Top" MinWidth="300"
              Background="AliceBlue"  ListBoxItem.Selected="listDocs_Selected" MouseDoubleClick="listDocs_MouseDoubleClick"
                  ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
            <ListView.Resources>
                <convert:ConverterExtToImage x:Key="converterExtToImage" />
            </ListView.Resources>
            <ListView.ContextMenu>
                 <ContextMenu Name="contMenu" StaysOpen="true" Background="Cornsilk" MenuItem.Click="contMenu_Click"  >
                    <ContextMenu.BitmapEffect>
                        <OuterGlowBitmapEffect />
                    </ContextMenu.BitmapEffect>
                     
                     <MenuItem Header="Vedi" Margin="2">
                    <MenuItem.Icon>
                            <Image Source="..\IMG\Read.gif"/>
                        </MenuItem.Icon>
                    </MenuItem>
                     
                     <MenuItem Header="Download" Margin="2">
                    <MenuItem.Icon>
                            <Image Source="..\IMG\downlMedia.gif"/>
                        </MenuItem.Icon>
                    </MenuItem>
                     
                    <MenuItem Header="Modifica" Margin="2" >
                        <MenuItem.Icon>
                            <Image Source="..\IMG\modMedia.gif"/>
                        </MenuItem.Icon>
                    </MenuItem>
                    
                      <MenuItem Header="Notifica" Margin="2">
                    <MenuItem.Icon>
                            <Image Source="..\IMG\notificaPicc.gif"/>
                        </MenuItem.Icon>
                    </MenuItem>
                      <MenuItem Header="Email" Margin="2">
                    <MenuItem.Icon>
                            <Image Source="..\IMG\email.jpg"/>
                        </MenuItem.Icon>
                    </MenuItem>
                      <MenuItem Header="Avvia iter" Margin="2">
                    <MenuItem.Icon>
                            <Image Source="..\IMG\iterPicc.gif"/>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Delete" Margin="2">
                    <MenuItem.Icon>
                            <Image Source="..\IMG\delMedia.gif"/>
                        </MenuItem.Icon>
                    </MenuItem>
                </ContextMenu>
            </ListView.ContextMenu>
            <ListView.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal" >
                    <Image x:Name="imgDoc" Width="16" Height="16" Stretch="UniformToFill"  Source="{Binding Ext, Converter={StaticResource converterExtToImage}}"  Tag="{Binding ID}" Margin="2"></Image>
                    <TextBlock Text="{Binding FileName}" Width="250" VerticalAlignment="Center" />                   
                 </StackPanel>
            </DataTemplate>
            </ListView.ItemTemplate>    
        </ListView>
            
            <!--<ListView.Resources>
        <local:SexToColorConverter x:Key="SexConverter" />
        <Style TargetType="{x:Type ListViewItem}">
            <Setter Property="Background"
                    Value="{Binding Path=Sex, Converter={StaticResource SexConverter}}" />
        </Style>
    </ListView.Resources>-->
        
        </Grid>
    </StackPanel>
</controlli:BaseCusControl>
